package com.ysx.teacher.day20210906;

public class Ch02 {

    public static void main(String[] args) {
        //  13231

        // 方法

        // 求第index位的那个数
        // 1 1
        // 2 3
        // 3 4
        int number=1342431;

        int len=7;

        // 套路...
        int wei=2;
        for(int index=wei;index<=len-1;index++){
            number=number/10;
            if(number<=10){
                break;
            }
        }
        System.out.println(number);

        int rs= number%10;
        System.out.println(rs);






        /*int counter=1;
        while(true){
            int rs = number/10;
            number=rs;
            if(rs==0){
                break;
            }else{
                counter++;
            }
        }*/

        //System.out.println(counter);


        /*boolean flag =check(string);

        if(flag==true){
            System.out.println(string +"是1个回文数");
        }else{
            System.out.println(string +"不是1个回文数");
        }*/
    }

    public static void check(int str){

       /* boolean result= false;

        char[] chars = str.toCharArray();

        int len=chars.length;

        System.out.println("数组的长度:"+len);

        int counter=len/2;
        System.out.println("循环的次数"+counter);

        // 0 1

        int cishu=0;
        for(int index=0;index<counter;index++){

            //分析
            if(chars[index]== chars[len-1-index]){
                cishu++;
            }else{
                result=false;
                break;
            }
        }

        if(cishu == counter){
            result=true;
        }else{
            result=false;
        }

        return  result;*/
    }
}
